package com.onepower.core.domain.mapper;

import com.onepower.core.domain.request.CreateMatchForm;
import com.onepower.core.domain.response.MatchInfo;
import com.onepower.core.modules.repository.entity.TkdMatch;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper
public interface MatchInfoMapper {

    MatchInfoMapper MAPPER = Mappers.getMapper(MatchInfoMapper.class);

    @Mapping(source = "matchTime", target = "matchTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    TkdMatch converter(CreateMatchForm form);

    @Mapping(target = "matchTime", source = "matchTime",dateFormat = "yyyy-MM-dd HH:mm:ss")
    MatchInfo converterInfo(TkdMatch tkdMatch);
}
